n, x = map(int, input().split())
s = input()
ans = sorted(s)
print(ans[x - 1])
